<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
	<!-- Required meta tags -->
	<meta charset="utf-8">
	<title>所有用户信息</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<!--favicon-->
	<link rel="stylesheet" th:href="@{/plugins/datatable/css/dataTables.bootstrap5.min.css}"/>
	<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
	<link th:include="admin/adminGoodsUtils-common::commonheader">
	<title>Rocker - Bootstrap 5 Admin Dashboard Template</title>
</head>

<body>
<!--wrapper-->
<div class="wrapper">
	<div th:replace="admin/adminGoodsUtils-common::#commonbody1"></div>
	<div th:replace="admin/adminGoodsUtils-common::#commonbody2"></div>
	<!--start page wrapper -->
	<div class="page-wrapper">
		<div class="page-content">
			<!--breadcrumb-->
			<div class="page-breadcrumb d-none d-sm-flex align-items-center mb-3">
				<div class="breadcrumb-title pe-3">用户数据全表</div>
				<div class="ps-3">
					<nav aria-label="breadcrumb">
						<ol class="breadcrumb mb-0 p-0">
							<li class="breadcrumb-item"><a href="javascript:;"><i class="bx bx-home-alt"></i></a>
							</li>
							<li class="breadcrumb-item active" aria-current="page">Data Table</li>
						</ol>
					</nav>
				</div>
			</div>
			<h3 class="mb-0 text-uppercase">住户信息表</h3>
			<hr/>
			<div class="card">
				<div class="card-body">
					<div class="table-responsive">
						<table id="example2" class="table table-striped table-bordered">
							<thead>
							<tr>
								<th>姓名</th>
								<th>身份证号</th>
								<th>手机号</th>
								<th>性别</th>
								<th>地址</th>
								<th>密码</th>
								<th>是否为老人</th>
								<th>操作</th>
							</tr>
							</thead>
							<tbody>
							<tr th:each="sysUser,statar:${list1}">
								<td th:text="${sysUser.getUsername()}"></td>
								<td th:text="${sysUser.getId()}"></td>
								<td th:text="${sysUser.getPhone()}"></td>
								<td th:text="${sysUser.getSex()}"></td>
								<td th:text="${sysUser.getAddress()}"></td>
								<td th:text="${sysUser.getPassword()}"></td>
								<td th:text="${sysUser.getOld()}==0?'否':'是'"></td>
								<td class="text-center">
									<button type="button" th:attr="data-el_id=${sysUser.getId()}" class="dome1 layui-btn layui-btn-sm layui-btn-radius layui-btn-normal">
										修改信息
									</button>
									<button type="button" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-danger"><a th:href="@{/governmentDodelete(id=${sysUser.getId()})}" style="color: #ffffff;text-decoration:none">冻结该账户</a>
									</button>
								</td>
							</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
			<hr/>
			<h3 class="mb-0 text-uppercase">派送员信息表</h3>
			<div class="card">
				<div class="card-body">
					<div class="table-responsive">
						<table id="example1" class="table table-striped table-bordered">
							<thead>
							<tr>
								<th>姓名</th>
								<th>手机号</th>
								<th>性别</th>
								<th>密码</th>
								<th>编号</th>
								<th>总完成单量</th>
								<th>总糖果数</th>
								<th>操作</th>
							</tr>
							</thead>
							<tbody>
							<tr th:each="sysUser,statar:${list2}">
								<td th:text="${sysUser.getUsername()}"></td>
								<td th:text="${sysUser.getPhone()}"></td>
								<td th:text="${sysUser.getSex()}"></td>
								<td th:text="${sysUser.getPassword()}"></td>
								<td th:text="${sysUser.getId()}"></td>
								<td th:text="${sysUser.getReward()}/2"></td>
								<td th:text="${sysUser.getReward()}"></td>
								<td class="text-center">
									<button type="button" th:attr="data-el_id=${sysUser.getId()}" class="dome1 layui-btn layui-btn-sm layui-btn-radius layui-btn-normal">
										修改信息
									</button>
									<button type="button" class="layui-btn layui-btn-sm layui-btn-radius  layui-btn-danger " >
										<a th:href="@{/governmentDodelete(id=${sysUser.getId()})}" style="color: #ffffff;text-decoration:none">冻结该账户</a>
									</button></td>
							</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!--end page wrapper -->
	<!--start overlay-->
	<div class="overlay toggle-icon"></div>
	<!--end overlay-->
	<!--Start Back To Top Button--> <a href="javaScript:;" class="back-to-top"><i class='bx bxs-up-arrow-alt'></i></a>
</div>
<!--end wrapper-->
<!-- Bootstrap JS -->
<script th:src="@{/plugins/bootstrap/js/bootstrap.bundle.min.js}"></script>
<!--plugins-->
<script th:src="@{/plugins/jquery.min.js}"></script>
<script th:src="@{/plugins/simplebar/js/simplebar.min.js}"></script>
<script th:src="@{/plugins/metismenu/js/metisMenu.min.js}"></script>
<script th:src="@{/plugins/perfect-scrollbar/js/perfect-scrollbar.js}"></script>
<script th:src="@{/plugins/datatable/js/jquery.dataTables.min.js}"></script>
<script th:src="@{/plugins/datatable/js/dataTables.bootstrap5.min.js}"></script>

<script>
	$(document).ready(function() {
		var table = $('#example1').DataTable( {
			lengthChange: false,
			buttons: [ 'copy', 'excel', 'pdf', 'print']
		} );
		table.buttons().container()
				.appendTo( '#example1_wrapper .col-md-6:eq(0)' );
		var table = $('#example2').DataTable( {
			lengthChange: false,
			buttons: [ 'copy', 'excel', 'pdf', 'print']
		} );
		table.buttons().container()
				.appendTo( '#example2_wrapper .col-md-6:eq(0)' );
	} );
	$('.dome1').on('click', function(){
		var id=$(this).data('el_id');
		var index=parent.layer.getFrameIndex(window.name);
		layer.open({
			type: 2,
			area: ['85%', '60%'],
			title:'修改用户信息',
			content: '/adminGoodsUtils-updateUserVo?id='+id,
			yes: function(){
				parent.layer.close(userList);
				parent.layer.closeAll();
				var index = parent.layer.index; //获取当前弹层的索引号
				parent.layer.close(userList); //关闭当前弹层
			},
		});
	})

</script>
<script th:src="@{/js/app.js}"></script>
</body>

</html>
